/* Check JER_BM_To_Schedule_Dumb(). */
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include "reed_sol-2.h"
#include "jerasure-2.h"
#include "galois-2.h"

using namespace std;

int main( int argc, char** argv )
{
	JER_Matrix *jm;
	JER_Bitmatrix *jbm;
	JER_Schedule *schedule;

	int m = atoi( argv[1] );
	int k = atoi( argv[2] );
	int w = atoi( argv[3] );
	int i;
	jm = reed_sol_vandermonde_coding_matrix( k, m, w );
	jbm = new JER_Bitmatrix( *jm );
	jbm->Print();
	schedule = JER_BM_To_Schedule_CSHR( jbm );

	for( i = 0; i <  schedule->Elts.size(); i++ )
	{
		fprintf( stdout, "<%d,%d,%d,%d,%d>\n", schedule->Elts[i][4], 
				schedule->Elts[i][0], schedule->Elts[i][1], 
				schedule->Elts[i][2], schedule->Elts[i][3] );
	}

	return 0;
}
